<?php
class IssueController extends ApplicationController {
	function index($params) {
        $this->total = Issue::count_all();
        $this->issues = Issue::find_all();
	}
    
    function show($params) {
        $this->issue = Issue::find_initial("SELECT * FROM issues WHERE id={$params['id']};");
    }
    
    function destroy($params) {
        echo "destroy";
    }
    
    function edit($params) {
        // do we have a new record, or an existing one
        if(isset($params['id'])) {
            $this->issue = Issue::find_initial("SELECT * FROM issues WHERE id={$params['id']};");
        } else {
            $this->issue = new Issue;
        }
    }
    
    function create() {
        echo "update";
    }
    
    function update($params) {
        echo "update";
    }
}
?>